package com.yizhuoyan.his.dao;

import com.yizhuoyan.his.entity.DocPrescriptionDetailEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * (DocPrescriptionDetail)表数据库访问层
 *
 * @author yizhuoyan@yizhuoyan.com
 * @since 2020-02-20 15:06:06
 */
public interface DocPrescriptionDetailDao extends TemplateDao<Long,DocPrescriptionDetailEntity>{

    //额外方法
    /**
     * 查询患者的西药
     * @param id
     * @return 西药药品
     * @throws Exception
     * @throws  NullPointerException
     */
    List<DocPrescriptionDetailEntity> selectPrescriptionDetailById( Long id) throws Exception;

    /**
     * 查询患者可退药
     * @param id
     * @return 返回对各可退 药品信息
     * @throws Exception
     */
    List<DocPrescriptionDetailEntity> selectPrescriptionDetailStateById( Long id) throws Exception;

    /**
     * 通过中成药id来删除处方详情
     * @param prescriptionId 中成药处方id
     * @throws Exception id不存在异常
     * @throws NullPointerException 数据不存在
     */
    void deleteByPrescriptionId(long prescriptionId)throws Exception;
}